package com.fingard.dsp.bank.reqrespobj.authforrec.detail;

import com.fingard.dsp.bank.reqrespobj.contract.detail.ReqContractDetail;
import com.fingard.xml.XElement;

public class ReqAuthForRecDetail {
	/*
    [0]PayNo缴费编号||[1]PayAcctName缴费客户姓名||[2]PayAccNo缴费客户账号||[3]CertType证件类型||[4]CertNo证件号码||[5]DeadLine到期日||
    [6]ReqReserved3请求备用字段3||[7]ReqReserved4请求备用字段4||[8]是否同行||[9]公私标志(0 对公 1对私)||[10]行号||
    [11]卡折标志||[12]业务单据号（保单号）||[13]投保单号||[14]手机号||[15]系统银行代码||[16]系统区域代码||[17]签约期限(年)
      <DetailRecord>
        2017092600025449||浦发1045133882||6225220100000018||2||||2021-09-30||||||1||1||111111111111
        2017092600025450||浦发1045133882||6225220100000017||2||||2021-09-30||||||0||0||
      </DetailRecord>
	 */
    /**
     * 缴费编号
     */
    public String authCode = "";

    public String oppActName = "";
    public String oppAct = "";

    /**
     * 0	身份证
     * 1	户口簿
     * 2	护照
     * 3	军官证
     * 4	士兵证
     * 5	港澳居民来往内地通行证
     * 6	台湾同胞来往内地通行证
     * 7	临时身份证
     * 8	外国人居留证
     * 9	警官证
     * 99	其他证件
     */
    public String certType = "";
    public String certNum = "";

    public String deadLine = "";
    public String reqReserved3 = "";
    /**
     * 手机号
     */
    public String reqReserved4 = "";

    /** 同行标志：1-同行，0-他行 */
    public String sameBnk = "";

    /** 公私标志： 1-对私,其他-对公*/
    public String isPrivate = "";
    
    public String cnapsCode = "";
    
    /** 卡折类型： 1-存折,2-卡,3-贷记卡,4-准贷记卡 */
    public String cardType = "";
    
    /** 业务单据号（保单号） */
    public String sourceNoteCode = "";
    
    /** 投保单号 */
    public String insuPolicyNum = "";
    
    /** 手机号 */
    public String cellPhone = "";
    
    /**系统银行代码，如工行值为“102”*/
    public String oppBank = "";
    
    /**系统区域代码*/
    public String oppArea = "";
    /**签约期限（年）*/
    public String authItem ="";
    public ReqAuthForRecDetail(String p_eachLine) {
        String[] vs = p_eachLine.trim().split("\\|\\|");
        if (vs != null) {
        	if (vs.length >= 4) {
                authCode = vs[0];
                oppActName = vs[1];
                oppAct = vs[2];
                certType = vs[3];
            }
            if (vs.length >= 6) {
                authCode = vs[0];
                oppActName = vs[1];
                oppAct = vs[2];
                certType = vs[3];
                certNum = vs[4];
                deadLine = vs[5];
            }
            if (vs.length >= 8) {
                reqReserved3 = vs[6];
                reqReserved4 = vs[7];
            }
            if (vs.length >= 11) {
                sameBnk = vs[8];
                isPrivate = vs[9];
                cnapsCode = vs[10];
            }
            if (vs.length >= 12) {
            	cardType = vs[11];
            }
            if (vs.length >= 13) {
            	sourceNoteCode = vs[12];
            }
            if (vs.length >= 14) {
            	insuPolicyNum = vs[13];
            }
            if (vs.length >= 15) {
            	cellPhone = vs[14];
            }
            if (vs.length >= 16) {
            	oppBank = vs[15];
            }
            if (vs.length >= 17) {
            	oppArea = vs[16];
            }
            if (vs.length >= 18) {
                authItem = vs[17];
            }
        }
    }

    public ReqAuthForRecDetail(XElement p_xelement) throws Exception {
        authCode = p_xelement.getSingleTextNotNull("PayNo");
        oppAct = p_xelement.getSingleTextNotNull("PayAccNo");
        oppActName = p_xelement.getSingleTextNotNull("PayAcctName");
        certType=p_xelement.getSingleTextNotNull("CertType");
        certNum=p_xelement.getSingleTextNotNull("CertNo");
        deadLine=p_xelement.getSingleTextNotNull("DeadLine");
        authItem=p_xelement.getSingleTextNotNull("AuthItem");
        reqReserved3=p_xelement.getSingleTextNotNull("ReqReserved3");
        reqReserved4=p_xelement.getSingleTextNotNull("ReqReserved4");
    }
    
    public ReqAuthForRecDetail(ReqContractDetail pContractDetail){
    	authCode = pContractDetail.authCode;
    	oppAct = pContractDetail.payAct;
    	oppActName = pContractDetail.payName;
    	certType = pContractDetail.certType;
    	certNum = pContractDetail.certNum;
    	deadLine = pContractDetail.deadLine;
    	reqReserved3 = pContractDetail.reqReserved1;
    	reqReserved4 = pContractDetail.reqReserved2;
    	this.cellPhone = pContractDetail.cellPhone;
    	this.isPrivate = pContractDetail.isPrivate;
    	this.oppBank = pContractDetail.payBankCode;
    	this.cardType = pContractDetail.cardType;
    	this.oppArea = pContractDetail.payArea;
    	this.sameBnk = pContractDetail.sameBnk;
    	this.sourceNoteCode = pContractDetail.sourceNoteCode;
    	this.cnapsCode = pContractDetail.cnapsCode;
    }
}
